Skip to content

feat(ledger): persist ledger on unprotected ledger-state branch (your chosen path)#22

Merged
KiranPranay merged 1 commit into
mainfrom
ledger-state-branch
Jul 10, 2026
Merged

feat(ledger): persist ledger on unprotected ledger-state branch (your chosen path)#22
KiranPranay merged 1 commit into
mainfrom
ledger-state-branch

Conversation

@KiranPranay

Copy link
Copy Markdown
Member

Your choice: the ledger-state branch path. github-actions[bot] can't be granted main-bypass (GitHub 422), so the ledger persists on a dedicated unprotected ledger-state branch — restored before each run, persisted after, via the Contents API. Cross-run coverage accounting works with the default GITHUB_TOKEN, no bypass, main untouched. Same three-way fence (schema+no-URL, pii_guard, one-path Contents API). Data PR excludes data/_meta. LEDGER_TO_MAIN gating dropped. Python code unchanged.

…h (no main bypass)

github-actions[bot] cannot be granted main-ruleset bypass (GitHub 422), so instead
of committing the ledger to protected main, each run restores it from — and persists
it to — a dedicated UNPROTECTED `ledger-state` branch via the Contents API. This
delivers cross-run coverage accounting with the default GITHUB_TOKEN, no bypass and
no loosening of main protection; main stays purely reviewed case data.

- New "Restore ledger from ledger-state" step before extraction; "Persist ledger to
  ledger-state" step after Validate+PII guard (creates the branch on first run).
- Same three-way fence: schema+no-URL validation, pii_guard over data/_meta, and the
  Contents API writing exactly one path.
- The data-review PR always excludes data/_meta (the ledger is never in it).
- Drops the LEDGER_TO_MAIN gating (unneeded — this just works).

CONTRIBUTING §Operations + LAUNCH_REVIEW K updated. Python code unchanged (the
pipeline still reads/writes the working-tree ledger; the workflow moves it to/from
the branch). Ledger unit + schema tests still green.
@KiranPranay KiranPranay merged commit 7d85d0d into main Jul 10, 2026
3 checks passed
@KiranPranay KiranPranay deleted the ledger-state-branch branch July 10, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant